package com.net.yl;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.HeaderMap;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * create by cjx on 2024/7/15
 * desc:
 */
public interface Api {

    /**
     * 激活设备
     */
    @POST("device/activate")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> activate(@Body RequestBody requestBody);

    /**
     * 获取设备信息（配置、菜品）
     */
    @POST("device/sync")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> sync(@HeaderMap Map<String, String> headers);

    /**
     * 获取设备配件
     */
    @POST("device/sync/component")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> syncComponent(@HeaderMap Map<String, String> headers);
    /**
     * 获取设备配件
     */
    @POST("device/sync/clean")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> syncClean(@HeaderMap Map<String, String> headers);

    /**
     * 获取商品信息
     */
    @POST("device/sync/product")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> syncProduct(@HeaderMap Map<String, String> headers);
    /**
     * 上传异常日志
     */
    @POST("log/crash/insert")
    Observable<ResponseBody> logCrashInsert(@Body RequestBody requestBody);

    /**
     * 创建支付订单
     */
    @POST("pay/create-url")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> createPayCode(@HeaderMap Map<String, String> headers, @Body RequestBody requestBody);

    /**
     * 创建支付订单
     */
    @POST("pay/create-payee")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> payWithCode(@HeaderMap Map<String, String> headers, @Body RequestBody requestBody);

    /**
     * 查询订单状态
     */
    @POST("pay/query")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> queryPayStatus(@HeaderMap Map<String, String> headers, @Body RequestBody requestBody);

    /**
     * 查询订单状态
     */
    @POST("pay/close")
    @Headers({"Content-Type: application/json;charset=UTF-8"})
    Observable<ResponseBody> closePay(@HeaderMap Map<String, String> headers, @Body RequestBody requestBody);
}
